package com.wlh.demo02;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadPoolDemo01 {
    public static void main(String[] args) {
        //创建线程池对象
        //包含两个线程对象
        ExecutorService service = Executors.newFixedThreadPool(2);
        //创建Callable实例对象
        MyCallable c = new MyCallable();

        service.submit(c);
        service.submit(c);
        service.submit(c);
        service.submit(c);
        service.submit(c);

        service.shutdown();
    }
}
